package com.zuikaku.shardingsql;

import com.zuikaku.shardingsql.util.FileUtil;
import com.zuikaku.shardingsql.util.ShardingUtil;

import java.io.*;
import java.util.Scanner;

public class Main {

    public static void main(String[] args){
        System.out.println("请输入目标数据库名称：");
        Scanner scanner = new Scanner(System.in);
        String dbName = scanner.next();
        System.out.println("请选择db/table的分隔符：(1)"+dbName+"X  (2)"+dbName+"-X  (3)"+dbName+"_X");
        int choose = scanner.nextInt();
        String separator = null;
        switch (choose){
            case 1:
                separator="";
                break;
            case 2:
                separator="-";
                break;
            case 3:
                separator="_";
                break;
            default:
                System.err.println("错误的输入");
                return;

        }
        try {
            ShardingUtil.changeSql2ShardSql(dbName,false,separator);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }




}
